package com.jk.hystrix;

import com.jk.dto.TbAdmin;
import com.jk.pojo.PagedResponse;
import com.jk.service.TbAdminServiceFegin;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class TbAdminServiceFeginHystrix implements FallbackFactory<TbAdminServiceFegin> {
    @Override
    public TbAdminServiceFegin create(Throwable throwable) {
        return new TbAdminServiceFegin() {

            @Override
            public PagedResponse<TbAdmin> findTbAdminList(TbAdmin tbAdmin, Integer pageNum, Integer pageSize) {
                log.debug("TbAdminServiceFeign接口下的findAdminList方法：用户列表分页查询服务远程接口熔断 :{},",throwable.toString(),throwable);
                return null;
            }

            @Override
            public void addTbAdmin(TbAdmin tbAdmin) {
                log.debug("TbAdminServiceFeign接口下的addTbAdmin方法：用户新增服务远程接口熔断 :{},",throwable.toString(),throwable);
            }

            @Override
            public TbAdmin findTbAdminByUserName(String username) {
                log.debug("TbAdminServiceFeign接口下的findTbAdminByUserName方法：通过用户获得用户信息服务远程接口熔断 :{},",throwable.toString(),throwable);
                return null;
            }

            @Override
            public void deleteTbAdminById(Integer id) {

            }

            @Override
            public TbAdmin getTbAdminById(Integer id) {
                return null;
            }

            @Override
            public void upTbAdmin(TbAdmin tbAdmin) {

            }

            @Override
            public void upstatus(TbAdmin tbAdmin) {

            }

            @Override
            public void updatestatus(TbAdmin tbAdmin) {

            }

            @Override
            public List<String> selectPermsByUserId(Integer id) {
                return null;
            }
        };
    }
}
